﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.MovieRecorder.CUiMRCRibbonBarRecorderButton
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using EngineeringInternalExtension;
using System;
using System.Drawing;
using System.Windows;


namespace DnProcessSimulateCommands.MovieRecorder;

internal class CUiMRCRibbonBarRecorderButton : 
  TxRibbonToolGroupElement,
  ITxRibbonToolGroupButton,
  ITxRibbonToolGroupElement,
  IMRCRecorderRibbonToolGroupButton
{
  protected Bitmap m_icon;
  protected string m_tooltip;

  public CUiMRCRibbonBarRecorderButton(string tooltip, string imageUri)
  {
    this.m_tooltip = tooltip;
    this.Tooltip = this.m_tooltip;
    this.m_icon = Image.FromStream(Application.GetResourceStream(new Uri(imageUri, UriKind.RelativeOrAbsolute)).Stream) as Bitmap;
  }

  public event EventHandler Click;

  public IntPtr Icon => this.GetButtonIcon();

  public bool IsEnabled => true;

  protected IntPtr GetIcon(Bitmap icon)
  {
    IntPtr icon1 = IntPtr.Zero;
    if (icon != null)
      icon1 = icon.GetHbitmap();
    return icon1;
  }

  protected virtual IntPtr GetButtonIcon() => this.GetIcon(this.m_icon);

  public virtual void OnClick()
  {
    if (this.Click == null)
      return;
    this.Click((object) this, new EventArgs());
  }

  internal virtual void ResetContent()
  {
  }

  public void Reset() => this.ResetContent();
}
